# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Damian Kurek <starfire24680@gmail.com>
pkgname=kodi-game-libretro-mame2003
pkgver=0.78.0.29
_realname=Matrix
pkgrel=1
pkgdesc="MAME 2003 GameClient for Kodi"
options="!check" # no test suite
url="https://github.com/kodi-game/game.libretro.mame2003"
arch="x86 x86_64 aarch64 armv7" # kodi
license="custom"
makedepends="cmake kodi-dev"
depends="kodi-game-libretro libretro-mame2003"
source="$pkgname-$pkgver-$_realname.tar.gz::https://github.com/kodi-game/game.libretro.mame2003/archive/$pkgver-$_realname.tar.gz"
builddir="$srcdir/game.libretro.mame2003-$pkgver-$_realname"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake/kodi
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
	rm -r "$pkgdir"/usr/lib/kodi/addons/game.libretro.mame2003/game.libretro.mame2003.so
	ln -s /usr/lib/libretro/mame2003_libretro.so \
		"$pkgdir"/usr/lib/kodi/addons/game.libretro.mame2003/game.libretro.mame2003.so
}

sha512sums="72614af0cdc17b45ddd4fc9ad498eefab2f5763a9a6f8757677ef623c74c52375a959649ad59a22d4b39bd6cf0f51151112f99404524d6e355104e25bdf50a67  kodi-game-libretro-mame2003-0.78.0.29-Matrix.tar.gz"
